import util from '@/libs/util';
import Cookies from 'js-cookie';
export default {
    name: 'exportable-table',
    data () {
        return {
            columns: [{
                title: '序号',
                key: 'rownum',
                align: 'center',
                width: 60,
                render: (h, params) => {
                    return h('div', {}, ((this.pageIndex - 1) * this.pageSize + params.index + 1));
                }
            }, {
                title: '操作员',
                key: 'updated_by'
            }, {
                title: '收费金额',
                key: 'total_amt'
            }, {
                title: '退款金额',
                key: 'refund_amt'
            }, {
                title: '实际金额',
                key: 'real_amt'
            }, {
                title: '缴费人数',
                key: 'payNum'
            }, {
                title: '退费人数',
                key: 'refundNum'
            }],
            data: [],
            total: 0,
            pageIndex: 1,
            pageSize: 10,
            baseuser: JSON.parse(Cookies.get('baseUser')),
        };
    },
    mounted () {
        this.loadList();
    },
    methods: {
        loadList :function() {
            util.ajax.post('/busine/bill/billSummary', util.toFormData({
                page: this.pageIndex,
                size: this.pageSize,
                orgId: this.baseuser.orgId
            })).then(res => {
                this.data = res.data.data.list;
                this.total = res.data.data.total;
            });
        }
    }
}